<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>sendmessage</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="css/chat.css">
	
  </head>
  <script language="JavaScript" type="">
  function checkSpeak()//检查发言是否为空
  {
   
  	if(document.chatForm.message.value=='')
  	{
  		 alert("发言不能为空!");
  		document.chatForm.message.focus();
  		return false;
  	}else{
  		document.chatForm.message.focus();
  		return true; 
  	}
  }
 </script>
 <script language="JavaScript" type="">
  function change()//用户切换房间
  {

    top.location.replace("ChangeRoomServlet?useraction=change");

  }
  </script>
 <script language="JavaScript" type="">
   function quitRoom()//退出系统,返回至首页
   {
		top.location.replace("ChangeRoomServlet?useraction=quit");
   }

 </script>
 <script language="JavaScript" type="">
   function drawtool()//绘图协同
   {
		top.location.replace("ChangeRoomServlet?useraction=draw");
   }

 </script>
  <body  bgcolor="#20c0c0">
   <form action="ChatServlet" method="post" name="chatForm" target="theIframe">
   <table border="0" width="100%" align="center" cellspacing="0" cellpadding="0">
    <tr valign="top">
        <td>
        <!-- 选择聊天对象，默认为对所有人 -->
        对象  <input type="text" name="receiver" size="8" style="font-size:9pt">
        动作<!--选择动作 -->
        <select name="action" size="1" style="font-size:9pt">
        <option value="no" selected>说话</option>
          <option value="友好地握着手说：">问好</option>
         
          <option value="不满的说：">不满</option>
          <option value="兴奋的说：">兴奋</option>
          <option value="委屈的说：">委屈</option>
          <option value="着急的说：">着急</option>
        </select>
        <input type="checkbox" name="secret" value="yes">悄悄话
        <br>
       
        <input type="text" name="message" size="35">
    <br>
  
    <!-- 发送消息 -->
    <input type="submit" name="sendmessage" value="发送信息" onclick="return checkSpeak();" >
    <!-- 切换房间 -->

    <input type="button" name="changeRoom" value="切换房间" onclick="change()" >

    <!-- 退出 -->
    <input type="button" name="quit" value="退出系统" onclick="quitRoom()" >
   
    
    </td>
    </tr>
    </table>
    <!-- 页面局部刷性-->
 <iframe id="theIframe" name="theIframe" width="0" height="0"></iframe>
    </form>
  </body>
</html>
